<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://displaytag.sf.net/el" prefix="display"%>
<%@ taglib uri="/WEB-INF/config/tld/fmt.tld" prefix="fmt"%>
<%@ taglib uri="http://ssh.org/selects" prefix="ssh"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;
String applicationPath = basePath + "/" + "application";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title></title>
		<link href="<%=path%>/css/jinmu_style.css" rel="stylesheet"
			type="text/css" />
		<script language="javascript" src="<%=path%>/js/util.js"></script>
		<script language="javascript" src="<%=path%>/js/SyncCommon.js"></script>
		<script language="javascript"
			src="<%=path%>/application/js/treeSelect.js"></script>
	</head>
	<body>
		<div id="divTree"
			style="position: absolute; background: #FFFFFF; left: 1px; top: 1px; height =250; width: 253px; display: none"></div>
		<html:form styleId="technicalForm" action="addTechnical.do?method=addTechnical"
			onsubmit="return save();">
			<input type ="hidden" name="id" id="id" value="${technicalForm.id}"/>
			<input type ="hidden" name="projectid" id="projectid" value="0"/>
			<input type ="hidden" name="projectid" id="projectid" />
			<table cellspacing="0" cellpadding="0" width="98%" align="center"
				border="0" class="margtb5">
				<tr>
					<td align="left" class="padl5 lan12">
						<img src="<%=path%>/images/img-11.gif" width="12" height="12">
						研发辅助 &gt; 技术资料管理 &gt; 新增
					</td>
				</tr>
			</table>

			<table cellspacing="1" cellpadding="0" width="98%" align="center"
				border="0" class="bgcolor2 margb5">

				<tr class="bgcolor">
					<td width="18%" align="right" class="zi13">
						<bean:message
							key="com.application.technical.entity.technical.createpage.title"
							bundle="technicalKey" /><font color="red">*&nbsp;</font>
						：
					</td>
					<td width="32%" align="left" class="pad2 zi13">
						<input size="30" type="text" id="title" name="title" value="" flag="true"  maxlength="50"  valid="required" errMsg="请输入资料名称！"/>

					</td>
					
					<td width="18%" align="right" class="zi13">
						<bean:message
							key="com.application.technical.entity.technical.createpage.type"
							bundle="technicalKey" /><font color="red">*&nbsp;</font>
						：
					</td>
					<td width="32%" align="left" class="pad2 zi13">
						 <ssh:select propertyName="type" pid="ZL_GW" type="2" defaultName=""/>
				
					</td>
				</tr>
				<tr class="bgcolor">
					<td width="18%" align="right" class="zi13">
						<bean:message
							key="com.application.technical.entity.technical.createpage.orgid"
							bundle="technicalKey" />
						：
					</td>
					<td width="32%" align="left" class="pad2 zi13">
						<input type="text" id="org" name="org" value="${sessionScope.loginUser.org}" readonly="readonly"  size="30" />
						<input type="hidden" id="orgid" name="orgid" value="${sessionScope.loginUser.oid}"  size="30" />
					</td>
					<td width="18%" align="right" class="zi13">
						<bean:message
							key="com.application.technical.entity.technical.createpage.operateid"
							bundle="technicalKey" />
						：
					</td>
					<td width="32%" align="left" class="pad2 zi13">
						
						<input type="text" id="uname" name="uname" value="${sessionScope.loginUser.rname}" readonly="readonly"  size="30" />
						<input type="hidden" id="operateid" name="operateid" value="${sessionScope.loginUser.id}"  size="30" />
						
						</td>
				</tr>
				<tr class="bgcolor">

					<td width="18%" align="right" class="zi13">
						上传时间：  
					</td>
					<td width="32%" align="left" class="pad2 zi13" colspan="3">
						<bean:write name="technicalForm" property="createdate" format="yyyy-MM-dd hh:mm:ss"/>

					</td>
				</tr>

			</table>
<iframe width="100%" height="150px" onload="this.height=show_attachment.document.body.scrollHeight"
							src="<%=path%>/queryAttachment.do?method=queryAttachment&fid=${technicalForm.id}&type=40005"
											; scrolling="no" frameborder="0" name="show_attachment"
											id="show_attachment"></iframe>

			<p>
			<p>
			<p>
			<table width="98%" align="center" border="0" cellspacing="0"
				cellpadding="0">
				<tr>
					<td align="center">
						<input class="buttonbg" id="but_save" style="cursor: hand"
							type="submit"
							value="<bean:message key='com.manager.common.technical.save' bundle="technicalKey"/>"
							name="but_save" />
						&nbsp;&nbsp;&nbsp;
						<input class="buttonbg" id="but_return" style="cursor: hand"
							type="button"
							value="<bean:message key='com.manager.common.technical.return' bundle="technicalKey"/>"
							name="but_return" onClick="javascript:history.go(-1);" />
					</td>
				</tr>
			</table>

		</html:form>
	</body>
</html>


<script>

function save(){
   if(validateForm(document.forms[0],'Y'))
   {
	   	if(technicalForm.type.value==""){
	   		alert("文件类型必须填写！");
	   		return false;
	   	}else{
			return true;
		}
    }else{
	return false;
    }
}
function chooseProject(){   
    var syncHelper = new SyncHelper();
	var url = "popuSelectProjectList.do?method=popuSelectProjectList&projectManager=${loginUser.id}&random=" + new Date();
	var searchWin = window.showModalDialog(url,window,"help:no;scroll:yes;resizable:no;status:0;dialogWidth:1000px;dialogHeight:600px;center:yes" ); 	
    if(searchWin){
         $("projectName").value = searchWin["projectName"]==undefined?"":searchWin["projectName"];
		 $("projectNo").value = searchWin["projectNo"]==undefined?"":searchWin["projectNo"];
		 $("projectid").value = searchWin["projectNo"]==undefined?"":searchWin["projectNo"];
		 syncHelper.selectedByValue(searchWin["projectOrg"],"projectOrg");
		 
		 //$jq("#projectOrg option").not(":selected").attr("disabled", "disabled");
    }
}

</script>





